package com.kanesoft.android.gdx.actors.fight;

import com.kanesoft.android.gdx.widgets.sprites.SpriteInfo;

public class FighterThrowFireball extends FightActorStateMachine {

    private FightActorObject fightActor;
    
    public FighterThrowFireball(SpriteInfo stateSpriteInfo, FightActorObject actor) {
        super(stateSpriteInfo, actor);
        fightActor = actor;
    }

    @Override
    public boolean OnEnter() {
        
        if (fightActor.getActorState() != null) {
            if (((fightActor.getActorState().equals(fightActor.waitingState)) ||  
             (fightActor.getActorState().equals(fightActor.walkingBackwardState)) || 
             (fightActor.getActorState().equals(fightActor.walkingForwardState)) ) == false) return false;
        }
        
        actorSprite.setAnimationInLoop(false);
        actorSprite.setSpriteInfo(stateSpriteInfo);

        return true;
    }

    @Override
    public boolean OnUpdate() {
        return fightActor.waitingState.OnUpdate();
    }

    @Override
    public String getStateName() {
        return "ThrowFireball";
    }

}
